﻿<?xml version="1.0" encoding="utf-8" ?>

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Helper.Core"
namespace="Helper.Core.Entity">
  
  <class name="User" table="T_USUARIO">
    
    <id name="Id" column="ISN_USUARIO">
      <generator class="increment"></generator> 
    </id>
    
    <property name="Name" not-null="true" column="USUNM_USUARIO" />
    
    <property name="Password" column="USUDS_SENHA" />

    <property name="Role" column="USUNR_HIERARQUIA" type="System.Int32"/>

    <many-to-one name="ParentBusiness" column="ISN_EMPRESA" class="Helper.Core.Entity.Business" fetch="join" cascade="delete"/>

    <many-to-one name="Sector" column="ISN_SETOR" class="Helper.Core.Entity.Sector" fetch="join" />
    
    
    
  </class>  
  
</hibernate-mapping>
